A portion of the disclosure of this patent document contains material which is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office patent file or records, but otherwise reserves all copyright rights whatsoever.
The present invention relates generally to information processing environments and, more particularly, to development and execution of database application programs which operate in a Web environment.
Computers are very powerful tools for storing and providing access to vast amounts of information. Computer databases are a common mechanism for storing information on computer systems while providing easy access to users. A typical database is an organized collection of related information stored as xe2x80x9crecordsxe2x80x9d having xe2x80x9cfieldsxe2x80x9d of information. As an example, a database of employees may have a record for each employee. Here, each record contains fields designating specifics about the employee, such as name, home address, salary, and the like.
Between the actual physical database itself (i.e., the records contained in data pages stored on a storage device) and the users of the system, a database management system or DBMS is typically provided as a software cushion or layer. In essence, the DBMS shields the database user from knowing or even caring about underlying hardware-level details. Typically, all requests from users for access to the data are processed by the DBMS. For example, information may be added or removed from data files, information retrieved from or updated in such files, and so forth, all without user knowledge of underlying system implementation. In this manner, the DBMS provides users with a conceptual view of the database that is removed from the hardware level. The general construction and operation of a database management system is known in the art. See e.g., Date, C., An Introduction to Database Systems, Volume I and II, Addison Wesley, 1990; the disclosure of which is hereby incorporated by reference.
DBMS systems have long since moved from a centralized mainframe environment to a de-centralized or distributed environment. One or more PC xe2x80x9cclientxe2x80x9d systems, for instance, may be connected via a network to one or more server-based database systems (SQL database server). Commercial examples of these xe2x80x9cclient/serverxe2x80x9d systems include Powersoft(trademark) clients connected to one or more Sybase SQL Server(trademark) database servers. Both Powersoft(trademark) and Sybase SQL Server(trademark) are available from Sybase, Inc. of Emeryville, Calif. As the migration to client/server continues, each day more and more businesses are run from mission-critical systems which store information on server-based SQL database systems, such as Sybase SQL Server(trademark). As a result, increasingly higher demands are being placed on server-based SQL database systems to provide enterprise-wide decision supportxe2x80x94providing timely on-line access to critical business information (e.g., through xe2x80x9cqueriesxe2x80x9d). Accordingly, there is much interest in improving the performance of such systems, particularly in the area of database query performance.
In existing PC-based client/server application environments there are situations in which many, perhaps hundreds, of users having widely variant levels of database expertise execute sophisticated database queries frequently and regularly on a single, powerful relational database management system (RDBMS). One example of such a situation is one in which a database is used to track information regarding a company""s employees. Such a database is relied upon and used many times a day by management staff, accounting staff, and personnel staff for various purposes. Since the people actually using the database are not necessarily fluent in database languages or procedures, it is necessary to have an effective, i.e., easy to use, and efficient interface between the user and the database itself.
Typically, the interface between the user and the database is programmed in advance by a database programmer using an application development package having various database xe2x80x9ctoolsxe2x80x9d, which range in sophistication from a programming language, e.g., the C programming language, to so-called xe2x80x9capplication buildersxe2x80x9d which provide software routines to automate some tasks, e.g., window managers to control data presentation effects such as xe2x80x9cpop-upxe2x80x9d windows, menu bars, and xe2x80x9cpull downxe2x80x9d menus. Such an interface typically employs graphics, color, and animation, all of which are CPU-intensive functions executed by the front-end desktop computer.
With the ever-increasing movement of computing to the Internet, there is great interest in extending database development tools to leverage the connectivity provided by the Internet. More particularly, developer users are particularly interested in tools that allow application software, including database application programs, to be xe2x80x9chostedxe2x80x9d by the user""s own browser.
A Database Development System is described that provides methodologies for creating an HTML database control object for use in a Client/Server Database System The system includes one or more Clients (e.g., Terminals or PCs) connected via a Network to a Server. In general operation, Clients store data in and retrieve data from one or more database tables resident on the Server by submitting SQL commands, some of which specify xe2x80x9cqueriesxe2x80x9dxe2x80x94criteria for selecting particular records of a table. The system includes a xe2x80x9cDataWindowxe2x80x9d(previously patented and described in commonly-owned U.S. Pat. No. 5,566,330) that provides a unique type of component or object used to retrieve, display, and manipulate data from a relational database or other data source. DataWindow objects have knowledge about the data they are retrieving, and present information according to user-specified display formats, presentation styles, validation rules, expressions and other data properties, so dynamic data is used in the most meaningful way.
In accordance with the present invention, the DataWindow component is adapted for providing an HTML DataWindow component that is well integrated with xe2x80x9cWebxe2x80x9d (i.e., xe2x80x9cWorld Wide Webxe2x80x9d) or hypertext technologies. The HTML DataWindow allows code-less creation and layout of forms, database queries, and result sets, automatic run-time generation of HTML and script for full range of DataWindow functionality, cross-browser HTML, with graceful degradation for older browsers, and client side validation (rules), date formatting, subtotals and computed columns.
A pure HTML DataWindow control is provided with the help of a Web page server (e.g., Sybase PowerDynamo(trademark), available from Sybase, Inc. of Emeryville, Calif.) and a server component (which is invoked from that Web page server). Sybase PowerDynamo(trademark) includes a Personal Web Server for use during development. The control is employed at design time to allow a developer to add database-driven content to his or her Web applications. In particular, using a Web or HTML DataWindow Design-Time Control (DTC) of the present intention, a developer visually drops the DataWindow onto an HTML editing surface (e.g., such as the previously-illustrated xe2x80x9cPaintersxe2x80x9d that are displayed in PowerBuilder), and modifies the DTC properties as appropriate. Server code to create the DataWindow at runtime is then generated automatically. Client side validation (rules) defined for the DataWindow is translated into script commands (e.g., JavaScript, available from Netscape of Mountain View, Calif.) and executed on the client. JavaScript is a scripting language developed by Netscape to enable Web authors to design interactive sites. Although it shares many of the features and structures of the full Java language, it was developed independently. Javascript can interact with HTML source code, enabling Web authors to spice up their sites with dynamic content. No script commands need be written manually, however.
The HTML DataWindow serves as a thin-client DataWindow implementation for Web applications that provides most of the data manipulation, presentation, and scripting capabilities of the PowerBuilder DataWindow, without requiring any PowerBuilder DLLs (i.e., PowerBuilder runtime dynamic link libraries) on the client. DataWindow validation rules, formatting, and edit styles are converted into equivalent HTML and JavaScript. HTML is generated that is suitable for the target browser (using absolute positioning for Internet Explorer and relative positioning for Netscape). A plurality of functions and events are implemented by the generation of JavaScript which is downloaded to the client. In this manner, the Web or HTML DataWindow DTC supports generation of a runtime DataWindow object in HTML. It offers a thin-client solution that provides most of the data manipulation, presentation, and scripting capabilities of the PowerBuilder DataWindow without requiring any PowerBuilder DLLs or plugins on the Web client. The DataWindow that displays in the Web browser looks very much like the DataWindow one-way design in the PowerBuilder DataWindow painter.
The HTML DataWindow uses a component running in a transaction server (such as Sybase Jaguar(trademark) transaction server or Microsoft Transaction Server (MTS)) cooperating with a dynamic page server (such as Sybase PowerDynamo(trademark) or Microsoft Active Server Pages in IIS) and communicating with a Web client via a Web server. The server component can also be called directly from the dynamic page server without a transaction server, but using a transaction server usually provides better performance (because database connections and instances of the component can be cached).
The overall method of operation of an HTML DataWindow of the present invention is as follows. First, in a Web browser, a user requests the URL (Universal Resource Locator) for a page. The Web server passes the request to the page server, which locates the template for the requested page and executes server-side scripts in the template. The server-side scripts connect to the server component, passing it information about the DataWindow and the database connection. Methods on the server component retrieve data required for the DataWindow from the database and translate the DataWindow definition, data, and state into HTML and JavaScript. The server component returns the HTML and JavaScript to the page server. Then, the page server replaces the server-side script in the requested Web page with the generated HTML and JavaScript and returns the page to the Web browser via the Web server. The user interacts with the HTML DataWindow, for example requesting the next page or updating the data. The Web server passes the URL with added action parameters to the page server. The cycle begins again for the next user requests (if any).
Operation of the HTML DataWindow stems from cooperation of two main components: a server component and a client control. The server component retrieves data from a database and returns HTML and JavaScript that represent the data and the DataWindow object definition to the page server. In a preferred embodiment, the server component is a PowerBuilder custom class user object that uses a data store (xe2x80x9cDataStorexe2x80x9d) to handle retrieval and updates and is deployed as a Jaguar (Sybase) or COM (Microsoft) distributed component. COM (Component Object Model) is a model for binary code developed by Microsoft that enables programmers to develop objects that can be accessed by any COM-compliant application; both OLE and ActiveX are based on COM. A DataStore is a nonvisual DataWindow control. DataStores act just like DataWindow controls except that they do not have many of the visual characteristics associated with DataWindow controls. Like a DataWindow control, a DataStore has a DataWindow object associated with it.
The server component includes methods that the developer calls in his or her Web page template to instantiate and configure the component. The HTML DataWindow client control, the other hand, represents the JavaScript and HTML that is generated by the server component and embedded in the page returned to the Web client. Client-side scripts that the developer adds to his or her Web page template and wrap in SCRIPT tags are embedded as JavaScript in the client control. Some features available on the client control are optional: events, methods, data update and validation, and display formatting for newly-entered data. The size of the generated JavaScript increases as one adds more client-side functionality. Events that are triggered on the client control and several of the client control methods do not require the server component to reload the page, so processing on the client is typically much faster than processing performed on the server.
The HTML DataWindow control is fully generated by the server component using standard HTML and JavaScript. The generated HTML control and the page server component cooperate to provide the DataWindow functionality. The server component is written in PowerScript (i.e., PowerBuilder scripting language) and deployed as an ActiveX and a server component (e.g., using Sybase Jaguar application server). The server component performs data access, optionally maintaining state and dynamically generating the HTML to render the control, with its data and state, for inclusion on a page. The generated HTML control assumes the existence of a page server and includes the current state of the DataWindow such that the server component can run in a fully stateless mode. It support navigations and optional data input, data modification, data validation, insert, delete and update. The version of the browser may be taken into account during HTML generation so that the functionality of the control will degrade as gracefully as possible.
Actual hosting of the control occurs as follows. First, the browser talks to a Web server via HTTP (HyperText Transfer Protocol). The Web server talks to a page server (e.g., Sybase Web.PB) via CGI, ISAPI or NSAPI. For an introduction to Internet communication protocols (e.g., HTTP), see e.g., William Stallings, The Backbone of the Web, BYTE, October 1996, the disclosure of which is hereby incorporated by reference. The page server, in response, loads a page template and runs the server side scripts. The server side scripts talks to the server component to generate the HTML control that represents the DataWindow and its current state. This generated HTML control is inserted into the template and returned to the client. When a navigation or action button is pressed on the HTML control, an HTML POST action is done to the same page, passing back the stored state, the action and any other page state. This request gets to the server side script running in the page template in the same manner as before. The server side script passes the action and context to the server component and then regenerates the HTML control. The newly generated HTML control is inserted into the template and returned to the client.